<template>
	<div>

		申请人：<a-input placeholder="请填写要申请的员工"  v-model="name"/>
		
		申请原因：<a-input placeholder="请填写申请原因" v-model="descrip"/>

		开始时间：
		<a-input-group compact>
		<a-select default-value="1">
			<a-select-option value="1">
			Between
			</a-select-option>
			<a-select-option value="2">
			Except
			</a-select-option>
		</a-select><br>
		
		<a-input style=" width: 100px; text-align: center" placeholder="开始时间" v-model="start_times" />
		<a-input
			style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"
			placeholder="~"
			disabled
		/>
		<a-input style="width: 100px; text-align: center; border-left: 0" placeholder="结束时间" v-model="end_time"/>
    	</a-input-group><br>

		审批人：<a-dropdown >
    <a class="ant-dropdown-link" @click="e => e.preventDefault()">
      Hover me <a-icon type="down" />
    </a>
    <a-menu slot="overlay">
      <a-menu-item>
        <a href="javascript:;">1st menu item</a>
      </a-menu-item>
      <a-menu-item>
        <a href="javascript:;">2nd menu item</a>
      </a-menu-item>
      <a-menu-item>
        <a href="javascript:;">3rd menu item</a>
      </a-menu-item>
    </a-menu>
  </a-dropdown><br>

		<br><a-button type="primary" @click="submit">提交</a-button><br/><br/>

		<a-button type="primary" ><router-link to ='addwork'>创建</router-link></a-button><br/>


		<br/><a-button type="primary" ><router-link to ='show'>查看进度</router-link></a-button><br/>

	</div>
</template>

<script>
import axios from 'axios'
export default {
	data () {
		return {
			name:'',
			descrip:'',
			start_times:'',
			end_time:'',
			approver:''
			
		}
	},

	methods:{
		submit(){
			let form_data = new FormData();
			form_data.append("name",this.name)
			form_data.append("descrip",this.descrip)
			form_data.append("start_times",this.start_times)
			form_data.append("end_time",this.end_time)
			form_data.append("approver",this.approver)
			axios({
              url:'http://127.0.0.1:8000/addapproves/',
              method:'post',
              data:form_data
            }).then(res=>{
              console.log(res)
	          
            })

		}
	}
}
</script>

<style>

</style>